﻿<Application    
    x:Class="BadHabit.Factory.Client"            
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:props="clr-namespace:BadHabit.Factory.Properties"
    xmlns:core="clr-namespace:System;assembly=mscorlib"    
    xmlns:BadHabit_Factory="clr-namespace:BadHabit.Factory"  
    xmlns:BadHabit_WPFTools="clr-namespace:BadHabit.WPFTools;assembly=BadHabit.WPFTools"
    xmlns:BadHabit_Factory_Converters="clr-namespace:BadHabit.Factory.Converters"
    xmlns:BadHabit_WPFTools_Converters="clr-namespace:BadHabit.WPFTools.Converters;assembly=BadHabit.WPFTools"
    xmlns:Factory_Core="clr-namespace:BadHabit.Factory;assembly=FactoryCore"    
    StartupUri="Windows/Splash.xaml"    
    >
       
    
    
    <Application.Resources>

       
        <ResourceDictionary>
            
            <!-- CONVERTERS -->
            <BadHabit_WPFTools_Converters:EnumConverter x:Key="EnumConverter"/>
            <BadHabit_WPFTools_Converters:EnumBooleanConverter x:Key="EnumBooleanConverter"/>
            <BadHabit_WPFTools_Converters:DoubleMultiplyConverter x:Key="MultiplyConverter"/>
            <BadHabit_WPFTools_Converters:LocalizeConverter x:Key="LocalizeConverter"/>
            
            <BadHabit_Factory_Converters:ArtifactImageConverter x:Key="ArtifactImageConverter"/>
            
            
            









            <!-- GENERIC COLLECTIONS -->
                        
            <ObjectDataProvider x:Key="ClientList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="ActiveTeamMemberList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="ProjectCategoryList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="ProjectModelList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="ProjectPlataformList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="BacklogItemSizeList" ObjectInstance="{x:Null}" />

            <ObjectDataProvider x:Key="ProjectMemberList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="ProposalTemplateList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="ProposalList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="UnitList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="GenericUnitList" ObjectInstance="{x:Null}"  />
            
            <ObjectDataProvider x:Key="VisibleBacklogItemList" ObjectInstance="{x:Null}"  />


            <!-- ENUMERATIONS -->
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="BacklogItemStatusList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:BacklogItemStatus"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="BacklogItemCancelReasonList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:BacklogItemCancelReasons"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="RiskImpactList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:RiskImpact"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="RiskProbabilityList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:RiskProbability"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="ProposalRejectReasonList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:ProposalRejectReasons"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
                
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="TaskTypeList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:TaskTypes"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="TaskStatusList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:TaskStatus"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="ProjectAccessModeList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:ProjectAccessMode"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type core:Enum}" x:Key="TeamRolesList">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Factory_Core:TeamRoles"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>


            
            <DataTemplate x:Key="TaskMoveToMenuItemTemplate">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding BacklogItemNumber}" Margin="0,0,10,0"/>
                    <TextBlock Text="{Binding Title}"/>
                    <TextBlock Text="{Binding SprintNumber, StringFormat='{}, sprint {0}'}"/>
                </StackPanel>
            </DataTemplate>

            <BadHabit_Factory_Converters:IsReadOnlyTaskConverter x:Key="IsReadOnlyTaskConverter"/>

            <ContextMenu x:Key="TaskContextMenu"
                         
                         DataContext="{Binding Path=PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
                <MenuItem>
                    <MenuItem.Header>
                        <BadHabit_WPFTools:ComboBox
                                        
                                        IsReadOnly="{Binding ., Converter={StaticResource IsReadOnlyTaskConverter}}"
                            
                                        BadHabit_WPFTools:SelectionBehavior.DropDownClosed="BadHabit_Factory:FactoryCommands.UnitChangeTask"
                                        
                                        Style="{StaticResource FormComboBox}"
                                        HorizontalAlignment="Stretch"
                                        
                                        ItemsSource="{Binding Source={StaticResource UnitList}}"                                     
                                        SelectedValue="{Binding UnitName}"
                                        DisplayMemberPath="UnitDescription"
                                        SelectedValuePath="UnitName"
                                        TextSearch.TextPath="UnitDescription"/>
                            
                    </MenuItem.Header>
                </MenuItem>

                <MenuItem IsChecked="{Binding Payable}" IsCheckable="True" Header="{x:Static props:Resources.Payable}" Command="BadHabit_Factory:FactoryCommands.IsPayableChangeTask"  />
                <MenuItem Header="{x:Static props:Resources.Cancel_Task}" Command="BadHabit_Factory:FactoryCommands.CancelTask" >
                    <MenuItem.Icon>
                        <Image Source="/Images/TaskStatus/32x32/TASK_CANCELED.png"  Width="16" Height="16" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="{x:Static props:Resources.Close_Task}" Command="BadHabit_Factory:FactoryCommands.DoneTask" >
                    <MenuItem.Icon>
                        <Image Source="/Images/TaskStatus/32x32/TASK_DONE.png"  Width="16" Height="16" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <Separator/>
                <MenuItem Header="{x:Static props:Resources.Add_a_File}" Command="BadHabit_Factory:FactoryCommands.AddTaskMaterial" >
                    <MenuItem.Icon>
                        <Image Source="/Images/Icons/attach.png" Width="16" Height="16" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="{x:Static props:Resources.Add_a_Link}" Command="BadHabit_Factory:FactoryCommands.AddTaskMaterialLink" >
                    <MenuItem.Icon>
                        <Image Source="/Images/Icons/attach.png" Width="16" Height="16" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>                            
                <Separator/>
                <MenuItem
                    Header="{x:Static props:Resources.Move_To_}"
                    ItemsSource="{Binding Source={StaticResource VisibleBacklogItemList}}"
                    
                    ItemTemplate="{StaticResource TaskMoveToMenuItemTemplate}">
                        <MenuItem.ItemContainerStyle>
                        <Style TargetType="MenuItem">
                            <Setter Property="Command" Value="{x:Static BadHabit_Factory:FactoryCommands.MoveTask}"/>
                            <Setter Property="CommandParameter" Value="{Binding}"/>
                        </Style>

                    </MenuItem.ItemContainerStyle>
                </MenuItem>


            </ContextMenu>
            
            <DataTemplate x:Key="BacklogItemUnitTemplate">
                <TextBlock>
                    <TextBlock Text="{Binding UnitName}" Margin="0,0,0,0"/>
                    <TextBlock Text="{Binding UnitDescription, StringFormat='{} - {0}'}"/>
                </TextBlock>                
            </DataTemplate>

        




            <ResourceDictionary.MergedDictionaries>                                
                <ResourceDictionary Source="Themes\FactoryBrushes.xaml" />
                <ResourceDictionary Source="Themes\FactoryFont.xaml" />
                <ResourceDictionary Source="Themes\FactoryBorder.xaml" />
                <ResourceDictionary Source="Themes\FactoryTextBlock.xaml" />
                <ResourceDictionary Source="Themes\FactoryTextBox.xaml" />                
                <ResourceDictionary Source="Themes\FactoryCheckBox.xaml" />
                <ResourceDictionary Source="Themes\FactoryButton.xaml" />
                <ResourceDictionary Source="Themes\FactoryMenu.xaml" />
                <ResourceDictionary Source="Themes\FactoryImage.xaml" />
                <ResourceDictionary Source="Themes\FactoryComboBox.xaml" />
                <ResourceDictionary Source="Themes\FactoryToolBar.xaml" />
                <ResourceDictionary Source="Themes\FactoryDataGrid.xaml" />
                <ResourceDictionary Source="Themes\FactoryCalendar.xaml" />
                <ResourceDictionary Source="Themes\FactoryOtherControls.xaml" />
                <ResourceDictionary Source="Themes\FactoryWindow.xaml" />
            </ResourceDictionary.MergedDictionaries>

            
            

            
            
            
            

        </ResourceDictionary>
        


        
        
        
    </Application.Resources>
</Application>
